//package com.onec.service.manage.config;
//
//
//import org.redisson.Redisson;
//import org.redisson.api.RedissonClient;
//import org.redisson.config.Config;
//import org.redisson.config.TransportMode;
//import org.redisson.spring.data.connection.RedissonConnectionFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//
///**
// * spring-data-redis redisson
// */
//@Configuration
//public class RedissonSpringDataConfig {
//
//
//    @Autowired
//    private Environment environment;
//
//    @Bean
//    public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redisson) {
//        return new RedissonConnectionFactory(redisson);
//    }
//
//    @Bean(destroyMethod = "shutdown")
//    public RedissonClient config() {
//
//        Config config = new Config();
//        config.setTransportMode(TransportMode.NIO);
//        // 设置服务节点部署模式: 集群、单一节点/主从模式/哨兵模式
//        // config.useClusterServers().addNodeAddress(env.getProperty("redisson.host.config"), env.getProperty("redisson.host.config"));
//        config.useSingleServer().setAddress(environment.getProperty("redisson.host.config")).setKeepAlive(true);
//
//        return Redisson.create(config);
//    }
//}
